<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ include file="/common/common.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/cases/source/";  //应用的地址名
String listActionName = basePath+"CaseSourceReceive.action?op=searchjs";
String lookActionName = basePath+"CaseSourceReceive.action?op=look";
String flowPageActionName = basePath+"CaseSourceReceive_caseSourceFlowPage.action";
String goBackActionName = basePath+"CaseSourceReceive_caseSourceGoBack.action";
String handOverActionName = basePath+"CaseSourceReceive_caseSourceHandOver.action";
String downActionName = basePath+"CaseSourceReceive_caseSourceDown.action";
String shActionName = basePath+"CaseSourceReceive_openShPage.action";
String showCaseSourceFileActionName = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/cases/check/CaseSourceCheck_showCaseSourceFile.action";
String chkId=request.getParameter("chkSelf");
String viewHearResultAction=basePath+"CaseSourceReceive_viewHearResult.action";
String checkPageActionName = basePath+"CaseSourceReceive_openCheckPage.action";
String exceutePageActionName = basePath+"CaseSourceReceive_openExceutePage.action";
String reportPageActionName = basePath+"CaseSourceReceive_openReportPage.action";
String zcdcPageActionName = basePath+"CaseSourceReceive_openZcdcPage.action";

String nsrPageActionName = basePath+"CaseSourceReceive_openNsrPage.action";

String shRevocationActionName = basePath+"CaseSourceReceive_openShRevocationPage.action";
String revocationActionName = basePath+"CaseSourceReceive_caseSourceRevocation.action";
String joinActionName = basePath+"CaseSourceReceive_openJoinPage.action";

%>

<html>
<head>
<title>jQuery EasyUI</title>
	<script type="text/javascript" src="<%=path %>/cases/main.js"></script>
	<script>
	var chkId='<%=chkId%>';
    $(function(){
	   $('a.easyui-linkbutton').linkbutton('enable');
	   $('#childMenuTree').tree({
		    url:'<%=path%>/cases/source/CaseSourceReceive_wsTree.action?vcRecordId=<%=chkId%>',
		    onClick: function(node){		    	
				addChildTab(node.text,'<%=path%>/cases/source/caseCheckNoticeShow.jsp?vcFileId='+node.id+'&fileName='+node.text);
			}
	   });
	});
	function addChildTab(subtitle,url){
	if(!$('#opCaseTabs').tabs('exists',subtitle)){
		$('#opCaseTabs').tabs('add',{
			title:subtitle,
			content:createFrame(url),
			closable:true
		});
	}else{
		$('#opCaseTabs').tabs('select',subtitle);		
	}	
}
	
	//移交
	function handOver(){
		
		addChildTab('移交','<%=handOverActionName%>?chkSelf=<%=chkId%>');
	}
	//签收
	function receive(){
		$.post("<%=path%>/cases/source/CaseSourceReceive_caseSourceReceiveSuccess.action",
				 {
			 		chkSelf:'<%=chkId%>'			 		
			 	},
		 		function(data){
		    try{
		            jsonReStr = jQuery.parseJSON(data);  //获取从服务器得到的数据反馈信息
		            if(jsonReStr.opState=="success"){    //操作成功处理
			            $.util.showTip({content:jsonReStr.opInfo});			            
		            }else if(jsonReStr.opState=="failure"){  //操作失败处理
		                $.messager.alert('消息提示','签收失败！原因如下：<br><font color=red>'+jsonReStr.opInfo+'</font>','error');
		            }
	            }catch(e){
	               $.messager.alert('消息提示','出现系统错误!可能原因如下：<br><font color=red>'+this.url+'页面地址未找到！或'+e+'</font>','error');
	            }
		 });//重置密码操作
	}
	//结案
	function end(){
		$.post("<%=path%>/cases/source/CaseSourceReceive_saveEndSuccessed.action",
				 {
			 		chkSelf:'<%=chkId%>'			 		
			 	},
		 		function(data){
		    try{
		            jsonReStr = jQuery.parseJSON(data);  //获取从服务器得到的数据反馈信息
		            if(jsonReStr.opState=="success"){    //操作成功处理
			            $.util.showTip({content:jsonReStr.opInfo});			            
		            }else if(jsonReStr.opState=="failure"){  //操作失败处理
		                $.messager.alert('消息提示','结案操作失败！原因如下：<br><font color=red>'+jsonReStr.opInfo+'</font>','error');
		            }
	            }catch(e){
	               $.messager.alert('消息提示','出现系统错误!可能原因如下：<br><font color=red>'+this.url+'页面地址未找到！或'+e+'</font>','error');
	            }
		 });//重置密码操作
	}
	
	//中止或终止
	function stop(i){
		$.post("<%=path%>/cases/source/CaseSourceReceive_saveStopSuccessed.action",
				 {
			 		chkSelf:'<%=chkId%>',
			 		vcEndType:i
			 	},
		 		function(data){
		    try{
		            jsonReStr = jQuery.parseJSON(data);  //获取从服务器得到的数据反馈信息
		            if(jsonReStr.opState=="success"){    //操作成功处理
			            $.util.showTip({content:jsonReStr.opInfo});			            
		            }else if(jsonReStr.opState=="failure"){  //操作失败处理
		                $.messager.alert('消息提示','结案操作失败！原因如下：<br><font color=red>'+jsonReStr.opInfo+'</font>','error');
		            }
	            }catch(e){
	               $.messager.alert('消息提示','出现系统错误!可能原因如下：<br><font color=red>'+this.url+'页面地址未找到！或'+e+'</font>','error');
	            }
		 });//重置密码操作
	}
	
	//重启
	function saveNewStartSuccessed(){
		$.post("<%=path%>/cases/source/CaseSourceReceive_saveNewStartSuccessed.action",
				 {
			 		chkSelf:'<%=chkId%>'			 		
			 	},
		 		function(data){
		    try{
		            jsonReStr = jQuery.parseJSON(data);  //获取从服务器得到的数据反馈信息
		            if(jsonReStr.opState=="success"){    //操作成功处理
			            $.util.showTip({content:jsonReStr.opInfo});			            
		            }else if(jsonReStr.opState=="failure"){  //操作失败处理
		                $.messager.alert('消息提示','结案操作失败！原因如下：<br><font color=red>'+jsonReStr.opInfo+'</font>','error');
		            }
	            }catch(e){
	               $.messager.alert('消息提示','出现系统错误!可能原因如下：<br><font color=red>'+this.url+'页面地址未找到！或'+e+'</font>','error');
	            }
		 });//重置密码操作
	}
	
	//回退
	function goBack(){
		addChildTab('回退','<%=goBackActionName%>?chkSelf=<%=chkId%>');
	}
	//撤销审核窗口
	function shRevocation1(){
		addChildTab('撤销审核','<%=shRevocationActionName%>');
	}
	//撤销提请窗口
	function revocation1(){
		addChildTab('撤销提请','<%=revocationActionName%>');
	}
	//合并窗口
	function join1(){
		addChildTab('撤销提请','<%=joinActionName%>');
	}
	function caseSourceFlowPage(){
		addChildTab('流程查看','<%=flowPageActionName%>?chkSelf=<%=chkId%>');
	}
	
	function openCheckPage(){
		addChildTab('检查情况','<%=checkPageActionName%>?chkSelf=<%=chkId%>');
	}
	
	function openExceutePage(){
		addChildTab('执行情况','<%=exceutePageActionName%>?chkSelf=<%=chkId%>');
	}
	function openReportPage(){
		addChildTab('举报信息','<%=reportPageActionName%>?chkSelf=<%=chkId%>');
	}
	function openNsrPage(){
		addChildTab('纳税人信息查看','<%=nsrPageActionName%>?chkSelf=<%=chkId%>');
	}
	function openHearPage(){
		addChildTab('审理情况查看','<%=viewHearResultAction%>?chkSelf=<%=chkId%>');
	}
	
	//打开待办页面
//	function pendingItems(id){
////		var rows = $('#searchTable').datagrid('getSelections');	
//		var num=rows[0].taxpayerNumber;
	//}
	
//审核
       function openShPage(){
    	  			
    	   defaultOpenWindow('<%=shActionName%>','审核案源',550,350,{chkSelf:'<%=chkId%>'},{},{but:[{id:'btnSubmit',name:'同意',classname:'icon-save'},{id:'btnSubmit2',name:'驳回',classname:'icon-save'}]});
       }
     
//撤销审核窗口
       function shRevocation(){
    	  			
    	   defaultOpenWindow('<%=shRevocationActionName%>','撤销审核',550,350,{chkSelf:'<%=chkId%>'},{},{but:[{id:'btnSubmit',name:'同意',classname:'icon-save'},{id:'btnSubmit2',name:'不同意',classname:'icon-save'}]});
       }
//撤销提请窗口
       function revocation(){
    	   defaultOpenWindow('<%=revocationActionName%>','撤销提请',550,350,{chkSelf:'<%=chkId%>'},{},{but:[{id:'btn_submit',name:'撤销',classname:'icon-save'}]});		
       }
//合并窗口
       function join(){
    	   defaultOpenWindow('<%=joinActionName%>','合并案源',550,350,{chkSelf:'<%=chkId%>'},{},{but:[{id:'btn_submit',name:'合并',classname:'icon-save'}]});		
       }       
       
       
//下达
       
       function downRow(){
    	  
    	   defaultOpenWindow('<%=downActionName%>','下发案源',550,350,{chkSelf:'<%=chkId%>'},{},{but:[{id:'downBtn',name:'下发',classname:'icon-save'}]});
       }
       
       function zcdc(){
     	  
    	   defaultOpenWindow('<%=zcdcPageActionName%>','暂存待查',550,350,{chkSelf:'<%=chkId%>'},{},{but:[{id:'downBtn',name:'暂存待查',classname:'icon-save'}]});
       }       
       
function createFrame(url)
{
	var s = '<iframe scrolling="auto" frameborder="0"  src="'+url+'" style="width:100%;height:100%;"></iframe>';
	return s;
}
	</script>
</head>
<body class="easyui-layout">
	<div region="north" border="false" style="height:50px;">
	<%
	//String orgType="";
	//if(request.getAttribute("orgType")!=null)	
	//	orgType=request.getAttribute("orgType").toString();
//	if(!"1".equals(orgType)){
	%>
	<%
//	}
	%>
	    <!--  -->
	    <s:if test="#request.showBtnYj=='true'">
	    <a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-up" onclick="handOver();">移交</a>
	    </s:if>
	    <s:if test="#request.showBtnQs=='true'">
	    <a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-up" onclick="receive();">签收</a>
	    </s:if>
	    <s:if test="#request.showShRevocationButton=='true'">
		<a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-undo" onclick="shRevocation();">撤销审批</a>
		</s:if>
		<s:if test="#request.showRevocationButton=='true'">
		<a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-undo" onclick="revocation();">撤销</a>
		</s:if>
		
		<s:if test="#request.showJoinButton=='true'">
		<a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-undo" onclick="join();">合并</a>
		</s:if>
		
	    <s:if test="#request.showBtnHt=='true'">
		<a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-undo" onclick="goBack();">回退</a>
		</s:if>
		<s:if test="#request.showBtnSh=='true'">
		<a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-undo" onclick="openShPage();">审核</a>
		</s:if>
		<s:if test="#request.showBtnDown=='true'">
		<a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-undo" onclick="downRow();">下发</a>
		</s:if>
		<s:if test="#request.showBtnReport=='true'">
		<a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-issued" onclick="openReportPage();">举报信息查看</a>
		</s:if>
		
		
		
		
		
		<s:if test="#request.showBtnZcdcButton=='true'">
		<a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-undo" onclick="zcdc();">暂存待查</a>
		</s:if>
		
		<s:if test="#request.showStopCheckButton=='true'">
		<a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-undo" onclick="stop(1);">中止检查</a>
		</s:if>
		
		<s:if test="#request.showEndCheckButton=='true'">
		<a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-undo" onclick="stop(2);">终止检查</a>
		</s:if>
		
		<s:if test="#request.showStopExecButton=='true'">
		<a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-undo" onclick="stop(3);">中止执行</a>
		</s:if>
		
		<s:if test="#request.showEndExecButton=='true'">
		<a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-undo" onclick="stop(4);">终止执行</a>
		</s:if>
		
		<s:if test="#request.showBtnNewButton=='true'">
		<a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-undo" onclick="saveNewStartSuccessed();">重启</a>
		</s:if>
		
		<s:if test="#request.showBtnEnd=='true'">
		<a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-undo" onclick="end();">结案</a>
		</s:if>
		
		
		
		<a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-issued" onclick="openNsrPage();">纳税人信息查看</a>
		<a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-issued" onclick="caseSourceFlowPage();">流程查看</a>
		<a href="#" class="easyui-linkbutton" plain="true" iconCls="ext-icon-page_edit" onclick="openCheckPage();">检查情况</a>
		<a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-issued" onclick="openHearPage();">审理情况</a>
		<a href="#" class="easyui-linkbutton" plain="true" iconCls="ext-icon-paintbrush" onclick="openExceutePage();">执行情况</a>
		
		
		
		<!-- 		
		<a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-reload">待办任务</a>
		<a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-invalid">大要案</a>
		<a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-search">案卷查询</a>
		 -->
	</div>
	<div region="west" split="true" title="多元菜单树" style="width:200px;padding:10px;">
     <ul id="childMenuTree" class="tree"> 
		 
	 </ul>
	</div>
	<div region="center">
	   <div id="opCaseTabs" class="easyui-tabs" fit="true" border="false">
			<div title="案源信息">
					  <iframe id="desktop" src="<%=lookActionName %>&chkSelf=<%=chkId %>" scrolling="auto" frameborder="0" style="width:100%;height:100%;">  
					  </iframe>

			</div>

			</div>	
			

		</div>
	</div>
</body>
</html>

